2020-2021 Sunseeker Telemetry and Lighting System
ucs_ex4_XTSourcesDCOInternal.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Macros

#define UCS_XT1_TIMEOUT   50000
 
#define UCS_XT2_TIMEOUT   50000
 
#define UCS_XT1_CRYSTAL_FREQUENCY   32768
 
#define UCS_XT2_CRYSTAL_FREQUENCY   24000000
 

Functions

void main (void)
 
void NMI_ISR (void)
 

Variables

uint8_t returnValue = 0
 
uint32_t clockValue
 
uint16_t status
 

Macro Definition Documentation

◆ UCS_XT1_CRYSTAL_FREQUENCY

#define UCS_XT1_CRYSTAL_FREQUENCY   32768

Definition at line 94 of file ucs_ex4_XTSourcesDCOInternal.c.

◆ UCS_XT1_TIMEOUT

#define UCS_XT1_TIMEOUT   50000

This program demonstrates using an external 32kHz crystal to supply ACLK, and using a high speed crystal or resonator to supply SMCLK. MLCK for the CPU is supplied by the internal DCO. The 32kHz crystal connects between pins Xin and Xout. The high frequency crystal or resonator connects between pins XT2IN and XT2OUT. The DCO clock is generated internally and calibrated from the 32kHz crystal. ACLK is brought out on pin P11.0, MCLK is brought out on P11.1, SMCLK is brought out on P11.2.

ACLK = LFXT1 = 32768Hz, MCLK = default DCO = 32 x ACLK = 1048576Hz SMCLK = HF XTAL An external watch crystal between XIN & XOUT is required for ACLK

         MSP430F54xA
      -----------------
 /|\ |              XIN|-
  |  |                 | 32kHz
  ---|RST          XOUT|-
     |                 |
     |                 |
     |            XT2IN|-
     |                 | HF XTAL or Resonator (add capacitors)
     |           XT2OUT|-
     |                 |
     |            P11.0|-->ACLK = 32kHz Crystal Out
     |                 |
     |            P11.1|-->MCLK
     |                 |
     |            P11.2|-->SMCLK = High Freq Xtal or Resonator Out

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • UCS module
  • GPIO Port peripheral

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • None.

Definition at line 80 of file ucs_ex4_XTSourcesDCOInternal.c.

◆ UCS_XT2_CRYSTAL_FREQUENCY

#define UCS_XT2_CRYSTAL_FREQUENCY   24000000

Definition at line 101 of file ucs_ex4_XTSourcesDCOInternal.c.

◆ UCS_XT2_TIMEOUT

#define UCS_XT2_TIMEOUT   50000

Definition at line 87 of file ucs_ex4_XTSourcesDCOInternal.c.

Function Documentation

◆ main()

◆ NMI_ISR()

void NMI_ISR ( void  )

Definition at line 202 of file ucs_ex4_XTSourcesDCOInternal.c.

References status.

Variable Documentation

◆ clockValue

uint32_t clockValue

Definition at line 115 of file ucs_ex4_XTSourcesDCOInternal.c.

Referenced by main().

◆ returnValue

uint8_t returnValue = 0

Definition at line 108 of file ucs_ex4_XTSourcesDCOInternal.c.

Referenced by main().

◆ status

uint16_t status

Definition at line 122 of file ucs_ex4_XTSourcesDCOInternal.c.

Referenced by NMI_ISR().